<?php
$user="junemann_nl";
$password="";
$database="junemann_nl";

$con = mysql_connect("localhost",$user,$password);
if(!$con)
{
	die("Unable to connect to server");
}

mysql_select_db($database, $con);

echo "<?xml version='1.0' encoding='UTF-8'?><characters>";

$resultChars = mysql_query("SELECT * FROM null_sk_characters");

while($charRow = mysql_fetch_array($resultChars))
{
  echo "<character id='". $charRow['ID'] ."' pos='" . $charRow['Pos'] . "' name='" . $charRow['Name'] . "'>";
  $resultLoot = mysql_query("SELECT * FROM null_sk_loot WHERE CharacterID = " . $charRow['ID']);
  while($lootRow = mysql_fetch_array($resultLoot))
  {
	echo "\n";  
	echo "<loot id='". $lootRow['ID'] ."' datetime='" . $lootRow['DateTime'] . "' itemid='" . $lootRow['ItemID'] . "' isoffspec='" . $lootRow['IsOffspec'] . "' />";
  }  
  echo "\n";  
  echo "</character>";  
}

echo "</characters>";

mysql_close($con);
?>